package com.max.mil.common.jdbc;

import javax.sql.DataSource;

import com.mchange.v2.c3p0.ComboPooledDataSource;

public class DBToolKit
{
	public static DataSource getDataSource() 
		{
			ComboPooledDataSource cpds = null;
		
			try
			{
				cpds = new ComboPooledDataSource();
			    cpds.setDriverClass("com.mysql.jdbc.Driver");
//			    cpds.setJdbcUrl("jdbc:mysql://113.10.242.67:3306/sq_maxchen");
//			    cpds.setUser("sq_maxchen");
//			    cpds.setPassword("a5nubz");
			    cpds.setJdbcUrl("jdbc:mysql://192.168.128.30:3306/fuwu_dev");
			    cpds.setUser("fuwu_user");
			    cpds.setPassword("fuwu_user");
//			    cpds.setJdbcUrl("jdbc:mysql://127.0.0.1:3306/test");
//			    cpds.setUser("root");
//			    cpds.setPassword("");
			    cpds.setMaxStatements(20);
			    cpds.setMaxPoolSize(10);
			}
			catch(Exception e)
			{
				e.printStackTrace();
			}
		    
		    return cpds;
		}
}
